<cfif Session.id EQ 0><cflocation url="../index.cfm"></cfif>

<cfobject name="comSettings" component="settings">
<cfparam name="action" default="">
<cfswitch expression="#action#">
	<cfcase value="password">
		<cfif form.newpassword NEQ form.newpassword2 >
			<strong>Die Passw&ouml;rter sind nicht gleich!</strong>
		<cfelse>
			<cfinvoke
				component="#comSettings#"
				method="password"
				oldpw="#form.oldpassword#"
				pssword="#form.newpassword#" >
			<cflocation url="settings.cfm?success=1">
		</cfif>
	</cfcase>
	
	<cfcase value="personalize">
		<cfinvoke
			component="#comSettings#"
			method="personalize"
			greeting="#form.greeting#"
			bereich="#form.bereich#">
		<cflocation url="settings.cfm?success=2">
	</cfcase>

	<cfdefaultcase>
		<cf_template i="1">
			<form method="post" action="settings.cfm?action=password">
				<fieldset style="float: left; margin: 0px 10px; width: 390px;">
					<legend>Passwort</legend>
				<cfif IsDefined('url.success')>
					<cfif url.success EQ '1'>
						<strong style="margin: 0px 0px 10px; color: #009000; display: block;">Erfolgreich gespeichert!</strong>
					</cfif>
				</cfif>
					<label for="oldpassword">Altes Passwort:</label>
						<input type="password" id="oldpassword" name="oldpassword">
					<label for="newpassword">Neues Passwort:</label>
						<input type="password" id="newpassword" name="newpassword">
					<label for="newpassword2">Wiederholen:</label>
						<input type="password" id="newpassword2" name="newpassword2">
					<p align="center"><input type="submit" value="Passwort &auml;ndern"></p>
				</fieldset>
			</form>
			<form method="post" action="settings.cfm?action=personalize">
				<fieldset style="float: left; margin: 0px 10px; width: 390px;">
					<legend for="greeting">Personalisierung</legend>
				<cfif IsDefined('url.success')>
					<cfif url.success EQ '2'>
						<strong style="margin: 0px 0px 10px; color: #009000; display: block;">Erfolgreich gespeichert!</strong>
					</cfif>
				</cfif>
					<label for="greeting">Begr&uuml;&szlig;ung:</label>
						<input type="text" name="greeting" id="greeting" value="<cfoutput>#Request.greeting#</cfoutput>">
					<label for="ausbilder">Ausbildungs-Bereich:</label>
						<input type="text" name="bereich" id="bereich" value="<cfoutput>#Request.bereich#</cfoutput>">
					<p align="center"><input type="submit" value="Speichern"></p>
				</fieldset>
			</form>
		</cf_template>
	</cfdefaultcase>
</cfswitch>